-
-
Notifications
You must be signed in to change notification settings - Fork 349
feat(enhanced): add include/exclude filtering support for shared modules #3904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ScriptedAlchemy
wants to merge
48
commits into
main
Choose a base branch
from
feat/basic-share-filtering
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Separate handling for container, federation, and remote dependencies - Improved support for runtimeChunk: 'single' configuration - Proper remote module hoisting using the new addRemoteDependency hook - Simplified cleanup logic for better performance - Changed runtime chunk detection to include all chunks with runtime - Added comprehensive unit tests
…oist-container-refs
- Add testRequestFilters and addSingletonFilterWarning utilities - Update ConsumeSharedPlugin with version and request filtering - Update ProvideSharedPlugin with version and request filtering - Update schemas to include include/exclude filter properties - Add comprehensive unit tests for filtering functionality - Add config test cases for consume and provide filtering 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5c7eabc The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes TypeScript error TS2742 where inferred type could not be named without portable React types reference. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed main entry path in project.json to correct location - Added extends to tsconfig.json to inherit base configuration - Added dependsOn configuration for proper build dependencies 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- add include/exclude properties to share plugin schema - update share plugin to pass through include/exclude filters to underlying plugins - generate updated typescript definitions and validation schemas - support version and request filtering for both include and exclude - part of pr4: basic share filtering - include/exclude by version
…ugin and ConsumeSharedPlugin - Add include/exclude version filtering support to ProvideSharedPlugin - Add include/exclude version filtering support to ConsumeSharedPlugin - Implement proper filtering logic that prevents filtered modules from being shared - Add type definitions for IncludeExcludeOptions interface - Update provide-filters integration test with proper share scope initialization - Fix unit test mock compilation to extend actual Compilation class - All tests passing (7/7 provide-filters tests, 13/13 unit tests) This implements PR4 (Basic Share Filtering - Include/Exclude by Version) requirements by allowing filtering of shared modules based on semantic version ranges. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…hare-filter branch This directory was accidentally created during development but doesn't exist in the original share-filter branch and was causing compilation errors. The provide-filters test is working correctly and all filtering functionality is properly implemented for PR4 (Basic Share Filtering).
60e2ad7
to
9bab6fb
Compare
- Add browser caching for Playwright and Cypress - Add explicit Cypress installation step - Add PLAYWRIGHT_CACHE_HIT environment variable - Add warm Nx cache step - Use --parallel=4 for faster builds - Align with build-and-test workflow strategy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add addRemoteDependency hook calls in RemoteModule.ts build method - Ensures HoistContainerReferencesPlugin can properly track remote dependencies - Calls hook for both RemoteToExternalDependency and FallbackDependency - Brings current branch in sync with share-filter branch hook implementations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update tsconfig.json to use TypeScript project references structure - Create missing tsconfig.lib.json and tsconfig.spec.json files - Update project.json to use tsconfig.lib.json and add external dependencies - Fix missing return statement in isStoryBook function - Fix NODE_ENV access to use bracket notation for strict mode - Brings rsbuild-plugin build configuration in line with other rollup packages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The main entry was pointing to the wrong path (packages/rsbuild-plugin/cli/src/index.ts) when it should be packages/rsbuild-plugin/src/cli/index.ts. This was causing TypeScript compilation errors during the build process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…nfig Similar to how SDK and other packages handle it, explicitly set the external array in rollup config to ensure proper handling of workspace dependencies during TypeScript compilation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing "types" field to package.json (like rspack and sdk have) - Add "noImplicitAny": false to tsconfig.json to match rspack's config - This should help TypeScript resolve workspace dependencies correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Use path.resolve with process.cwd() to create absolute paths for the input files, matching how other packages like rspack handle their rollup configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Match the path format used by other packages like data-prefetch which use 'packages/package-name/src/...' relative paths. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…lution The root cause was manually overriding rollupConfig.external which broke nx's automatic workspace dependency resolution mechanism. By removing this override and letting nx handle externals via project.json, TypeScript can now properly resolve workspace dependencies during the rollup build. This aligns rsbuild-plugin with working packages like cli and data-prefetch that don't manually override external configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove dep-graph.json and deps.json files that were accidentally committed during the investigation process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add explicit TypeScript path mappings in tsconfig.json to help the TypeScript compiler resolve workspace dependencies during CI builds. This should resolve the module resolution issues in stricter CI environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Build SDK with skip cache first to ensure workspace dependencies are available - Then build all packages with normal caching to resolve TypeScript module resolution issues - This ensures workspace packages are properly built and available for dependent packages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update the RemoteModule test build describe block to properly mock the FederationModulesPlugin.getCompilationHooks method to match the implementation on share-filter branch. This resolves the TypeError about compilation argument validation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add comment to force CI to rebuild modernjs package which was missing files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Ensure proper cleanup of module mocks between test runs to prevent compilation instance validation errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace instance-level mocking with module-level mocking to avoid webpack Compilation instance validation errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fix the mock to directly export the plugin instead of wrapping it in a default property, matching the actual default import pattern. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Trigger another build attempt to resolve missing dist files in CI. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Reduce parallel build workers in devtools workflow to prevent race conditions and improve build reliability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Allow the warm cache step to use cache for better performance while keeping skip cache only for the main build step. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Accept utilities and webpack dependencies in app package.json files - Use tsconfig.lib.json for rsbuild-plugin project - Accept incoming pnpm-lock.yaml changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add import caching to SDK importNodeModule to prevent circular calls - Add import caching to node runtime plugin importNodeModule - Add ESM module caching to prevent loadModule recursion - Use direct dynamic import in vm.Script fallback to avoid cycles - Add regression test for maximum call stack exceeded scenario Fixes RangeError: Maximum call stack size exceeded when NextJS apps use Module Federation with both SDK and node runtime plugin importing each other's modules through importModuleDynamically callbacks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Now that import caching prevents infinite recursion, we can use the proper importNodeModule function instead of the workaround in vm.Script importModuleDynamically fallback. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…dule directly Remove vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER fallback since caching prevents recursion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…OADER Prefer using vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER when available, fallback to cached importNodeModule to prevent recursion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Export the cache and clear it in beforeEach to ensure test isolation. The caching mechanism was causing tests to reuse cached promises from previous tests instead of running the intended mocked behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Use direct export declaration instead of separate export statement to match the pattern used by all other exports in the file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Resolved conflict in .github/workflows/build-and-test.yml (kept main version) - Resolved conflict in packages/rsbuild-plugin/project.json (kept both main changes and dependsOn config) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
6ae92a4
to
787ba92
Compare
- Remove unnecessary wrapper functions in ConsumeSharedPlugin and ProvideSharedPlugin - Use createLookupKeyForSharing utility function directly - Remove singleton warnings for request include/exclude filters - Keep singleton warnings only for version include/exclude filters - Sync devtools.yml with main branch 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements basic share filtering functionality for ConsumeSharedPlugin and ProvideSharedPlugin, allowing fine-grained control over which shared modules are consumed or provided based on version requirements and request patterns.
Part of incremental PR plan - Step 4: Basic Share Filtering
Features Added
Technical Implementation
ConsumeSharedPlugin
with version and request filtering logicProvideSharedPlugin
with version and request filtering logictestRequestFilters
utility for request pattern matchingaddSingletonFilterWarning
utility for singleton filter warningsTest Plan
🤖 Generated with Claude Code